package com.zyh.scs.admin.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zyh.scs.admin.api.dto.UserHistoryRechargeDTO;
import com.zyh.scs.admin.service.UserHistoryRechargeService;
import com.zyh.scs.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hwh
 * @ClassName: 用户充值 批量充值列表
 * @Description: $
 * @Date $
 * @Version 1.0
 */
@RestController
@AllArgsConstructor
@RequestMapping("/history/recharge")
@Tag(description = "history/recharge", name = "批量充值列表")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class UserHistoryRechargeController {

    private final UserHistoryRechargeService userHistoryRechargeService;

    /**
     * 分页查询 批量充值列表
     *
     * @param page        参数集
     * @return 用户集合
     */
    @GetMapping("/page")
    @Operation(summary = "分页查询 批量充值列表", description = "分页查询 批量充值列表")
    @PreAuthorize("@pms.hasPermission('scsx_history_recharge_view')")
    public R getUserPage(@ParameterObject Page page,@ParameterObject UserHistoryRechargeDTO userHistoryRechargeDTO) {
        return R.ok(userHistoryRechargeService.getRechargePage(page,userHistoryRechargeDTO));
    }


}
